package com.example.springcloud.service;

import com.example.springcloud.entity.Payment;
import com.example.springcloud.utils.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Service
@FeignClient("CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    String urlPath = "/spring-cloud/payment";

    @GetMapping(urlPath + "/get/{id}")
    ResultEntity<Payment> getPayment(@PathVariable("id") Long id);

    @GetMapping(urlPath + "/feignTimeoutTest")
    String feignTimeoutTest() throws InterruptedException;

}
